home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2 Examples.sit / Raven 1.2 Examples / BoxPaint / Source / App.cpp next >
Text File  |  1997-04-13  |  3KB  |  124 lines

  1. /*
  2.  *  File:       App.cpp
  3.  *  Summary:       Application object.
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1996-1997 Jesse Jones. All Rights Reserved.
  7.  *
  8.  *  Change History (most recent first):    
  9.  *
  10.  *         <2>     4/12/97    JDJ        Doesn't call PRECONDITION in dtor.
  11.  *         <1>     5/25/96    JDJ        Created
  12.  */
  13.  
  14. #include "App.h"
  15.  
  16. #include <ZDialogUtils.h>
  17. #include <ZMiscUtils.h>
  18. #include <ZRegularDesktop.h>
  19. #include <ZWindow.h>
  20.  
  21. #include "Doc.h"
  22.  
  23.  
  24. // ===================================================================================
  25. //    class CApplication
  26. // ===================================================================================
  27.  
  28. //---------------------------------------------------------------
  29. //
  30. // CApplication::~CApplication
  31. //
  32. //---------------------------------------------------------------
  33. CApplication::~CApplication()
  34. {
  35. }
  36.  
  37.  
  38. //---------------------------------------------------------------
  39. //
  40. // CApplication::CApplication
  41. //
  42. //---------------------------------------------------------------
  43. CApplication::CApplication()
  44. {
  45.     mNumFileTypes = 1;
  46.     mFileTypes[0] = 'PICT';
  47.  
  48. //    POSTCONDITION(true);            // wait till HandleInit is called (by Run)            
  49. }
  50.  
  51. #pragma mark ハ
  52.  
  53. //---------------------------------------------------------------
  54. //
  55. // CApplication::OnAboutBox
  56. //
  57. //---------------------------------------------------------------
  58. void CApplication::OnAboutBox()
  59. {
  60.     (void) DoAlert(256);
  61. }
  62.  
  63.  
  64. //---------------------------------------------------------------
  65. //
  66. // CApplication::OnCreateDoc
  67. //
  68. //---------------------------------------------------------------
  69. TDocument* CApplication::OnCreateDoc()
  70. {
  71.     CDocument* doc = new CDocument(this);
  72.     
  73.     // Documents are reference counted and are created with their
  74.     // ref count being zero. TDocWindow dtor decrements its document's
  75.     // reference count. If there are no other references to the
  76.     // document the document is deleted.
  77.     (void) TWindow::Create(256, doc);
  78.     
  79.     return doc;
  80. }
  81.  
  82.  
  83. //---------------------------------------------------------------
  84. //
  85. // CApplication::OnOpenWithoutDoc
  86. //
  87. //---------------------------------------------------------------
  88. void CApplication::OnOpenWithoutDoc()
  89. {
  90.     this->HandleOpen();
  91. }
  92.  
  93.  
  94. //---------------------------------------------------------------
  95. //
  96. // CApplication::OnMenuCommand
  97. //
  98. //---------------------------------------------------------------
  99. bool CApplication::OnMenuCommand(const MenuCommand& command)
  100. {
  101.     bool handled = false;
  102.     
  103.     handled = Inherited::OnMenuCommand(command);
  104.     
  105.     return handled;
  106. }
  107.  
  108.     
  109. //---------------------------------------------------------------
  110. //
  111. // CApplication::OnCommandStatus
  112. //
  113. //---------------------------------------------------------------
  114. bool CApplication::OnCommandStatus(const MenuCommand& command, SCommandStatus& status)
  115. {
  116.     bool handled = false;
  117.     
  118.     handled = Inherited::OnCommandStatus(command, status);
  119.     
  120.     return handled;
  121. }
  122.  
  123.  
  124.